package cn.edu.scau.cmi.wuzhenxin.client;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
public class SingletonClient extends Application {
    @Override
    public void start(Stage primaryStage) {
        try {
            Parent root = FXMLLoader.load(getClass().getResource("singleton.fxml"));//修改了
            //BorderPane root = new BorderPane();
            //设置Scene的大小(SceneBuilder中点击AnchorPane右边Layout中会显示大小,不一样的可以)
            Scene scene = new Scene(root,536,600);//修改了
//            scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
            primaryStage.setScene(scene);
            primaryStage.setResizable(false);//设置不能窗口改变大小
            primaryStage.setTitle("一个简单的JavaFX");//设置标题
            primaryStage.show();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
    public static void main(String[] args) {
        launch(args);
    }
	public void openNewView() {//用于综合性实验开启界面
		Stage stage = new Stage();
		try {
			Parent root = FXMLLoader.load(getClass().getResource("singleton.fxml"));
			stage.setScene(new Scene(root));
			stage.setTitle("实验2：单例模式");
			stage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}

